package com.hotcat.proxy;

import com.hotcat.proxy.factory.Human;
import com.hotcat.proxy.factory.impl.ProxyFactory;
import com.hotcat.proxy.factory.impl.SuperMan;

/**
 * 动态代理
 * @author xu.biao
 * @version v1.0
 * @Package com.hotcat.proxy.factory
 * @data 2021/11/28 16:01
 */
public class DynamicProxy {
    public static void main(String[] args) {
        SuperMan superMan = new SuperMan();
        Human instance = (Human) ProxyFactory.getProxyInstance(superMan);
        String say = instance.getSay();
        System.out.println("正在说：" + say);
        instance.eat("麻辣香锅");
    }
}
